﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BFlatCompile.Serializer
{
	internal static class Phase0d5CreateRawSourceLookup
	{
		public static void Do(Compiler compiler, List<string[]> files, Dictionary<string, int> indexByFilename)
		{
			int index = 1;

			foreach (string path in compiler.InputFiles)
			{
				string contents = compiler.GetFileFromPath(path);
				if (contents != null)
				{
					files.Add(new string[] { path, contents });
					indexByFilename[path] = index++;
				}
			}
		}
	}
}
